package com.num2.dao.wly;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;

public interface IChartDao {
	
	@Select("SELECT transaction_date,balance FROM transaction_record WHERE user_id=#{user_id} ORDER BY transaction_id DESC LIMIT 7")
	List<Map<String,Object>> getBalanceDateById(Integer user_id);
	
	@Select("select ui.user_id,balance,name from user_info ui," +
				 "(select user_id,balance from transaction_record as a where " +  
				 "transaction_id=(select max(b.transaction_id) from transaction_record " + 
				 "as b where a.user_id = b.user_id)) as a where ui.user_id=a.user_id " +
				 "group by a.user_id ORDER BY balance desc limit 0,10")
	List<Map<String,Object>> getRichListChart();
}